﻿run subst D: C:\D 
run subst P: C:\D\php\www
;run subst M: C:\D\python\spiderNews
run subst R: C:\D\temp
run C:\D\Program Files\goagent-b7a3a8f0553d\local\goagent.exe


SetCapsLockState AlwaysOff
tts := ComObjCreate("SAPI.SpVoice")
;tts.Speak("启动成功")

;function
setOn(){
    IfExist, on.ico
    Menu TRAY, Icon, on.ico
}


setOff(){
    IfExist, off.ico
    Menu TRAY, Icon, off.ico
}

tip(s,t)
{
    TrayTip,, %s%
    SetTimer, RemoveTrayTip, %t%
    return
    RemoveTrayTip:
    SetTimer, RemoveTrayTip, Off
    TrayTip
    return
}

;设置图标
setOff()
tip("start",800)

;重载脚本
capslock & m::
send ^s
sleep 100
Reload
Sleep 1000 
tip("can't reload",5000)
return



#o::  ; Win+O 热键关闭显示器.
;tts.Speak("关闭显示器 ")
;Sleep 1000  
SendMessage, 0x112, 0xF170, 2 ,, Program Manager  ; 0x112 为 WM_SYSCOMMAND, 0xF170 为 SC_MONITORPOWER.
return



;save提示
$~^s::
tip("save ok",1000)
;tts.Speak("保存成功")
return


AppsKey::RButton ;鼠标右键

capslock & up::MouseClick, WheelUp, , , 2 
capslock & down::MouseClick, WheelDown, , , 2

; 上下左右  hjkl asdw
capslock & k::send {up}
capslock & w::send {up}
capslock & j::send {down}
capslock & s::send {down}
capslock & h::send {left}
capslock & a::send {left}
capslock & l::send {right}
capslock & d::send {right}

capslock & i::send {end}
capslock & u::send {home}
capslock & o::send {PgUp}
capslock & p::send {PgDn}

capslock & n::run D:\Desktop\Desktop\Notepad2.exe 
capslock & q::send !{space}c  ;退出程序
capslock & space::click  ;单击
capslock & x::send {Delete}
capslock & f::run C:\D\Program Files\Everything\Everything.exe


capslock & r:: ;阅读单词
send ^c
tts.Speak(clipboard)
return
;纯文本复制
capslock & c::
send ^c
sleep,200
clipboard=%clipboard%
tip( clipboard ,2000)
sleep,500
return



capslock::
setOn()
Input, t, I T5, z
,cmd,py,ipy,ipn,qq,st,putty,ping
,ipc,bd,kg,mail,chrome
,ie,goagent,vs,sleep
,ppt,word,excel
,on,bj,yd,mc,wamp
,pc,pd,pe,pf
,sbj,help,wllj
,desk
,sxy
,con

setOff()
if ErrorLevel = Timeout
{

    tip(t,2000)
    tts.Speak(t)
    return
}
else tip(t,5000)


if t=cmd  
run cmd

if t=con
run C:\D\Program Files\Console2\c.exe

if t=py
run  python

if t=ipy
run ipython

if t=ipn
run python notebook

if t=qq
run C:\Program Files (x86)\Tencent\QQ\Bin\QQ.exe

if t=st
run D:\Program Files\SublimeText3\Sublime Text Build\sublime_text_crack_3059x32.exe

if t=putty
run D:\Program Files\puttyfile_0.62cn\putty.exe

if t=ping
{
    run cmd
    WinWait ahk_class ConsoleWindowClass
    send ping 
}

if t=ipc
{
run cmd
WinWait ahk_class ConsoleWindowClass
send ipconfig`n
}


if t=bd
run www.baidu.com


if t=kg
run D:\Program Files\KuGou\KuGou.exe

if t=mail
send 978750903@qq.com

if t=chrome
run chrome

if t=ie
run iexplore


if t=goagent
run D:\Program Files\goagent-b7a3a8f0553d\local\goagent.exe

if t=vs
run C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\WDExpress.exe


if t=sleep
run C:\Windows\System32\rundll32.exe powrProf.dll,SetSuspendState


if t=ppt
run C:\Program Files\Microsoft Office\Office15\POWERPNT.EXE

if t=word
run C:\Program Files\Microsoft Office\Office15\WINWORD.EXE

if t=excel
run C:\Program Files\Microsoft Office\Office15\EXCEL.EXE

if t=on
run C:\Program Files\Microsoft Office\Office15\ONENOTE.EXE

if t=bj
run C:\Windows\System32\StikyNot.exe

if t=yd
run D:\Program Files\Dict\YodaoDict.exe

if t=mc
run D:\Program Files\MacType\MacTray.exe

if t=wamp
run D:\php\wamp\wampmanager.exe

if t=pc
run c:/


if t=pd
run d:/


if t=pe
run e:/


if t=pf
run f:/


if t=sbj
{
    send ^c
    IfWinNotExist ahk_class Sticky_Notes_Note_Window 
    run C:\Windows\System32\StikyNot.exe
    sleep 1000
    WinActivate ahk_class Sticky_Notes_Note_Window
    send ^{end}{enter}
    send %Clipboard%
}

if t=help
run D:\ahk\AutoHotkey.chm

;网络连接 
if t=wllj
run "::{26EE0668-A00A-44D7-9371-BEB064C98683}\3\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}" 


if t=desk
run D:\ahk\myahk\桌面切换.ahk

;tts.Speak("启动 "+t)


if t=sxy
run tencent://message/?uin=824063246

return






;#IfWinActive ahk_class SWT_Window0

;:?*:zs::$scope.  
;:?*:zz::z
;:?*:zs::$scope.  
;:?*:zd::{esc}debugger;{enter}
;:?*:zl::console.log();{left}{left}
;:?*:zv::var_dump($);{left}{left}
;:?*:zx::{esc}$


;控制台粘贴
#IfWinActive ahk_class ConsoleWindowClass
^v::
send %Clipboard%
return


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;vs2013
#IfWinActive ahk_class HwndWrapper[DefaultDomain;;921a6803-6b8b-42c0-8b80-071a50e55070]
^enter::send ^+{enter}
^+enter::send ^{enter}
f5::^f5

;c++头文件
:?*:c++head::
Clipboard  =
(
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <cstdio>
#include <set>
#include <vector>
#include <map>
#include <math.h>
#include <algorithm>
#include <memory.h>
#include <utility>
#include <string>
#include <sstream>
#include <stdlib.h>
#include <time.h>
#include <assert.h>
#include <limits>
using namespace std;
)
send ^v
return


;快速跳行
`::
t3=
Input, t1, I T1 L3 *, ,0,1,2,3,4,5,6,7,8,9
Input, t2, I T1 L3 *, ,0,1,2,3,4,5,6,7,8,9
IfEqual t1,1,Input, t3, I T1 L3 *, ,0,1,2,3,4,5,6,7,8,9
t=%t1%%t2%%t3%
tip(t,2000)
send ^g%t%{enter}
return

#IfWinActive
;;END vs2013



; 编辑框   ^u 清空
ActiveControlIsOfClass(Class) {
    ControlGetFocus, FocusedControl, A
    ControlGet, FocusedControlHwnd, Hwnd,, %FocusedControl%, A
    WinGetClass, FocusedControlClass, ahk_id %FocusedControlHwnd%
    return (FocusedControlClass=Class)
}

;#If ActiveControlIsOfClass("Edit")
;^u::
;send ^a{delete}
;tip("edit",2000)
;#If


;ctrl+退格 删除单词
^bs::
send +^{left}
return




;for Dexpot
#z::send ^!+t
#x::send ^!+w



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

